package com.yunhe.policyfulfillment.authority.repository;

import com.yunhe.policyfulfillment.authority.domain.PolicyCompanyUser;
import com.yunhe.policyfulfillment.authority.model.PolicyCompanyUserQueryCondition;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description 政策兑现企业用户
 * @author hetao
 * @date 2021-08-24
 */
@Repository
public interface PolicyCompanyUserRepository {

    /**
     * 新增
     * @author hetao
     * @date 2021/08/24
     **/
    int createPolicyCompanyUser(PolicyCompanyUser policyCompanyUser);

    /**
     * 新增
     * @author hetao
     * @date 2021/08/24
     **/
    int createPolicyCompanyUserSelective(PolicyCompanyUser policyCompanyUser);

    /**
     * 刪除
     * @author hetao
     * @date 2021/08/24
     **/
    int deletePolicyCompanyUserByPrimaryKey(@Param("id") int id);

    /**
     * 更新
     * @author hetao
     * @date 2021/08/24
     **/
    int updatePolicyCompanyUserByPrimaryKey(PolicyCompanyUser policyCompanyUser);

    /**
     * 更新
     * @author hetao
     * @date 2021/08/24
     **/
    int updatePolicyCompanyUserByPrimaryKeySelective(PolicyCompanyUser policyCompanyUser);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/08/24
     **/
    PolicyCompanyUser searchPolicyCompanyUserByPrimaryKey(@Param("id") int id);

    /**
     * 根据账号密码查询账号
     * @param userAccount 账号
     * @param password    密码
     * @return PolicyCompanyUser
     */
    PolicyCompanyUser searchPolicyCompanyUserByUserAccountAndPassword(@Param("userAccount")String userAccount,
                                                                      @Param("password")String password);
    /**
     * 根据账号查询账号
     * @param userAccount 账号
     * @return PolicyCompanyUser
     */
    PolicyCompanyUser searchPolicyCompanyUserByUserAccount(@Param("userAccount")String userAccount);

    /**
     * @Description 分页筛选企业用户
     * @Param PolicyCompanyUserQueryCondition policyCompanyUserQueryCondition
     * @Return List<PolicyCompanyUser>
     * @Date 2021/9/18 14:35
     */
    List<PolicyCompanyUser> findPolicyCompanyUserByCondition(PolicyCompanyUserQueryCondition policyCompanyUserQueryCondition);

    /**
     * @Description 修改密码
     * @Param Long id, String password, Long updatePerson
     * @Return
     * @Date 2021/9/18 14:57
     */
    void updatePassword(@Param("id") Long id, @Param("password") String password,@Param("updatePerson") Long updatePerson);

    /**
     * @Description 禁用/恢复 企业账号
     * @Param Long ids, String activity, String remark, Long updatePerson
     * @Return
     * @Date 2021/9/18 15:05
     */
    void updateActivity(@Param("id") Long ids,@Param("activity") String activity,@Param("remark") String remark,@Param("updatePerson") Long updatePerson);
}
